<template>
  <div class="newsDetails">
    <div class="return" @click="back">
      <span>返回上一级</span>
      <img src="@/assets/images/return_you.png" alt />
    </div>
    <h1>{{title}}</h1>

    <div class="content" v-html="content"></div>
  </div>
</template>
<script>
import { oarticle_visit } from "@/api/contactUs.js";
import { news_details } from "@/api/news.js";
export default {
  data() {
    return {
      content: "",
      title: ""
    };
  },
  mounted() {
    let id = this.$route.query.id;
    let regionId = this.$route.query.regionId;

    if (regionId == 14) {
        news_details({ id: id }).then(res => {
      if (this.$isMobile()) {
        this.content = this.$pxToRem(res.data.data.content);
      } else {
        this.content = res.data.data.content;
      }
      this.title = res.data.data.title;
    });
    } else {
      oarticle_visit({ id: id }).then(res => {
        if (this.$isMobile()) {
        this.content = this.$pxToRem(res.data.data.content);
      } else {
        this.content = res.data.data.content;
      }
        this.title = res.data.data.title;
      });
    }
  },
  methods: {
    back() {
      this.$router.go(-1); //返回上一层
    }
  }
};
</script>
<style scoped src="./sass/contactUs.css"></style>